package com.qf.searchFeign;

import com.qf.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jiangjingbo
 * @version V1.0
 * @Project java2203
 * @Package com.qf.searchFeign
 * @Description:
 * @Date 2022/7/6 20:34
 */
@RestController
@RequestMapping("/search")
//feign接口需要 微服务的服务名,fallback = SearchFeign.class
//feign接口需要填写背调有的微服务名
@FeignClient(name = "QF-SEARCH",fallback = FeignSave.class)
public interface Feign {

    @RequestMapping("/test")
    public String test();

    //带参数的传承
    @RequestMapping("/findid/{id}")
    public User findById(@PathVariable("id") Integer id);

    @RequestMapping("/user/{id}")
    public User test1(@PathVariable("id")Integer id);

    @RequestMapping("/test2")
    public String Test2();
}
